(function($f) { $f.extend.app("f57f6913-4976-49af-accd-436191818bcf", function(self) {

	"use strict";

	
	// plugin info
	this.info = {
		// title of the plugin
		title: "My Application",
		version: "0.0.1", // major.minor.build
		description: "This is my application."
	};

	// plugin/feature files which are to be loaded during app initialization process
	// value of each item here should be 
	// { name: "", file: "", cond: "a optional function that returns true/false for conditional include"  }
	// plugins are loaded in specified order one after another
	// only (JS) files can be defined in here
	this.plugins = [ 
		{ name: "myPlugin1", file: "plugins/myPlugin1.debug.js" },
		{ name: "myPlugin2", file: "plugins/myPlugin2.debug.js" },
		{ name: "myFeature1", file: "features/myFeature1.debug.js" }
	];

	// plugin events, subscriptions and handlers
	this.events = { 
		// a namespace for all the events in this plugin
		// when events are registered globally, this will be prefixed with
		// all specified events of this plugin
		// E.g., if the namespace is: AppName.Pages.Order
		// and event name is "Created"
		// the publicly registered event that will be AppName.Pages.Order.Created		
		namespace: "com.myCompany.myApp",

		// define one item for each event - at runtime this will be replaced by an event object
		// each item here is defined as:
		// <FriendlyEventName>: "ScopeQualifiedEventName"
		// a scope qualified event name must be unique across application 
		// each event object has three methods
		//	publish(args)
		// 	subscribe(handler)
		//	unsubscribe(handler)
		// ... event definitions goes here ...
		
		// event 1
		event1: "event1",
		
		// event 2
		event2: "event2",
		
		// event subscriptions
		// define one item for each subscription - at runtime this will wire event subscriptions
		// and will be replaced by an event subscriptions object
		// each item here should be defined such:
		// <eventHandlerFunctionName>: ["FullyQualifiedEventNameToWhichToBindTo", "..."]
		// These eventHandlerFunctionName must exists under "eventHandlers" section
		subscriptions: { 
			onPluginsEvent1: ["com.myCompany.myApp.Plugin1.event1", "com.myCompany.myApp.Plugin2.event1"],
			onPluginsEvent2: ["com.myCompany.myApp.Plugin1.event2", "com.myCompany.myApp.Plugin2.event2"]
		},
	
		// event handlers
		// each item define one event handler as:
		// <eventHandlerFunctionName>: function(e) { }
		// e is an object having following properties:
		//	name: fully qualified name of the event (incuding namespace)
		//	sender: sender object of the event
		//	args: what args were passed when event was raised
		//	cancel: a method to cancel further execution of the event propogation code
		handlers: { 
			onPluginsEvent1: function(e) {
				$("#eventsLog").append("<p>App has handled '" + e.name + "' event of " + e.sender.info.title + ". Args: " + e.args[0].toString());
			},
			
			onPluginsEvent2: function(e) {
				$("#eventsLog").append("<p>App has handled '" + e.name + "' event of " + e.sender.info.title + ". Args: " + e.args[0].toString());
			}
		}
	};
}); }(fluid));